Skip to content

Conversation

Hi-Im-David
Copy link
Contributor

@Hi-Im-David Hi-Im-David commented Aug 13, 2025

PR for the mspi_dw driver to support Async and DMA transactions and support for the new nrf-mspi peripheral (name tbc). This peripheral is similar to the exmif in nRF54H20, using the same core designware IP, but has been configured to support DMA and slave mode. The DMA being used is part of the wrapper and not the core IP.

Concurrent Aync transactions and XiP support for nrf-mspi will be added in a future PR. The DMA support uses the DMA in a vendor specific wrapper.

@Hi-Im-David
Copy link
Contributor Author

Hi-Im-David commented Aug 13, 2025

Current known issues/to do list for this PR:

  • Async timeout support
  • Move start_next_packet call in async transactions to work thread
  • Length of DMA transactions are inconsistent
  • Tidy commits
  • Rebase

To be done in follow-up PR:

  • HW bug described in Jira ticket
  • Endian configuration
  • (stretch) Concurrent Async transactions
  • XiP support for nrf-mspi
  • API edit for a read only (no sending of cmd and addr) function
  • nrf-mspi naming issue

@Hi-Im-David Hi-Im-David changed the title [WIP] Mspi dw dma async support [WIP] MSPI_DW DMA and Async support Aug 13, 2025
@Hi-Im-David Hi-Im-David changed the title [WIP] MSPI_DW DMA and Async support MSPI_DW DMA and Async support Aug 13, 2025
@Hi-Im-David Hi-Im-David force-pushed the mspi-dw-dma-async-support branch 2 times, most recently from ce8a013 to c095bba Compare August 15, 2025 16:14
@Hi-Im-David Hi-Im-David force-pushed the mspi-dw-dma-async-support branch 4 times, most recently from 266a237 to aa46e61 Compare August 20, 2025 14:48
@Hi-Im-David Hi-Im-David marked this pull request as ready for review August 20, 2025 14:53
@Hi-Im-David Hi-Im-David force-pushed the mspi-dw-dma-async-support branch 3 times, most recently from 3b17e2e to 3c55ba4 Compare August 27, 2025 10:26
@zephyrbot zephyrbot requested a review from decsny August 27, 2025 10:27
@Hi-Im-David
Copy link
Contributor Author

Hi-Im-David commented Sep 24, 2025

I haven't managed to go through all the code yet but there is already quite a few issues to be addressed.

Thanks very much for your review @anangl, lots of helpful comments. Hopefully the latest push fixes most of them. I've also added a few replies to your comments for your input.

@Hi-Im-David Hi-Im-David force-pushed the mspi-dw-dma-async-support branch 2 times, most recently from 0fa1414 to 1d94cb0 Compare September 26, 2025 15:09
#define MSPI_DW_DMA_XFER_LIST_GET(inst) &mspi_dw_##inst##_transfer_list
#define MSPI_DW_DMA_JOBLIST_GET(inst) &mspi_dw_##inst##_joblist

static inline void vendor_specific_start_dma_xfer(const struct device *dev)
Copy link
Member

@anangl anangl Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it actually beneficial to have three separate functions: vendor_specific_start_dma_xfer(), vendor_specific_setup_dma_xfer(), and vendor_specific_dma_accessible_check(), instead of just one that would do all that is needed to start the DMA transfer?

Copy link
Contributor Author

@Hi-Im-David Hi-Im-David Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have resolved an issue which means we do not need seperate vendor_specific_start_dma_xfer() and vendor_specific_setup_dma_xfer() functions but I still believe we need a seperate vendor_specific_dma_accessible_check() function even if we are now calling it from just start_next_packet now. I think this check should happen before any configuration of the peripheral so it doesn't remain initialised on error. I guess we could also call the finalize_transceive/finalize_packet functions to cleanup on the error but not sure this is a better solution?

Hi-Im-David and others added 7 commits October 15, 2025 18:17
The nrf-qspi-v2 peripheral is similar to EXMIF on nrf54h20
but supports DMA and slave-mode. The wrapper around
the SSI IP is also different with DMA features.

Signed-off-by: David Jewsbury <[email protected]>
Support for new MSPI peripheral where there is no PSEL
so pins are setup through CTRLSEL.

Signed-off-by: David Jewsbury <[email protected]>
This is a new callback option that drivers can use for when a request
or xfer has timed out. E.g if an Async RX request never received
anything, this callback can be used so a user can clean up their
application.

Signed-off-by: David Jewsbury <[email protected]>
enum mspi_op_mode in mspi.h has different syntax to this binding.
Aligning these will allow for cleaner code in the implmented drivers.

Signed-off-by: David Jewsbury <[email protected]>
Handling of asynchronous transfers uses the system workqueue,
hence they are not available when multithreading is disabled.

Also add missing dependency on multithreading in the
MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE Kconfig option.

Signed-off-by: David Jewsbury <[email protected]>
Signed-off-by: Andrzej Głąbek <[email protected]>
MSPI slave mode is selected through devicetree using the
op-mode property. Mode selected by SSIISMST bit in the
CTRLR0 register. EXMIF can only be Master (controller).

Signed-off-by: David Jewsbury <[email protected]>
Initial DMA support. DMA supports implementation of SSI IP but using vendor
specific DMA in the wrapper. The setup of the DMA is done in
mspi_dw_vendor_specific.h.

Signed-off-by: David Jewsbury <[email protected]>
@Hi-Im-David Hi-Im-David force-pushed the mspi-dw-dma-async-support branch from 523f677 to 6875795 Compare October 15, 2025 17:30
@Hi-Im-David Hi-Im-David requested a review from anangl October 15, 2025 17:30
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants